home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / shmem_wait.z / shmem_wait
Encoding:
Text File  |  2002-10-03  |  13.0 KB  |  158 lines

  1.  
  2. SHMEM_WAIT(3)                                                 SHMEM_WAIT(3)
  3.  
  4.  
  5. NNNNAAAAMMMMEEEE
  6.      sssshhhhmmmmeeeemmmm____iiiinnnntttt____wwwwaaaaiiiitttt, sssshhhhmmmmeeeemmmm____iiiinnnntttt____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll, sssshhhhmmmmeeeemmmm____iiiinnnntttt4444____wwwwaaaaiiiitttt,
  7.      sssshhhhmmmmeeeemmmm____iiiinnnntttt4444____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll, sssshhhhmmmmeeeemmmm____iiiinnnntttt8888____wwwwaaaaiiiitttt, sssshhhhmmmmeeeemmmm____iiiinnnntttt8888____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll,
  8.      sssshhhhmmmmeeeemmmm____lllloooonnnngggg____wwwwaaaaiiiitttt, sssshhhhmmmmeeeemmmm____lllloooonnnngggg____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll, sssshhhhmmmmeeeemmmm____lllloooonnnngggglllloooonnnngggg____wwwwaaaaiiiitttt,
  9.      sssshhhhmmmmeeeemmmm____lllloooonnnngggglllloooonnnngggg____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll, sssshhhhmmmmeeeemmmm____sssshhhhoooorrrrtttt____wwwwaaaaiiiitttt, sssshhhhmmmmeeeemmmm____sssshhhhoooorrrrtttt____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll,
  10.      sssshhhhmmmmeeeemmmm____wwwwaaaaiiiitttt, sssshhhhmmmmeeeemmmm____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll - Waits for a variable on the local
  11.      processing element (PE) to change
  12.  
  13. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.      C or C++:
  15.  
  16.         ####iiiinnnncccclllluuuuddddeeee <<<<mmmmpppppppp////sssshhhhmmmmeeeemmmm....hhhh>>>>
  17.  
  18.         vvvvooooiiiidddd sssshhhhmmmmeeeemmmm____iiiinnnntttt____wwwwaaaaiiiitttt((((iiiinnnntttt ****_v_a_r,,,, iiiinnnntttt _v_a_l_u_e))));;;;
  19.  
  20.         vvvvooooiiiidddd sssshhhhmmmmeeeemmmm____iiiinnnntttt____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll((((iiiinnnntttt ****_v_a_r,,,, iiiinnnntttt _c_o_n_d,,,, iiiinnnntttt _v_a_l_u_e))));;;;
  21.  
  22.         vvvvooooiiiidddd sssshhhhmmmmeeeemmmm____lllloooonnnngggg____wwwwaaaaiiiitttt((((lllloooonnnngggg ****_v_a_r,,,, lllloooonnnngggg _v_a_l_u_e))));;;;
  23.  
  24.         vvvvooooiiiidddd sssshhhhmmmmeeeemmmm____lllloooonnnngggg____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll((((lllloooonnnngggg ****_v_a_r,,,, iiiinnnntttt _c_o_n_d,,,, lllloooonnnngggg _v_a_l_u_e))));;;;
  25.  
  26.         vvvvooooiiiidddd sssshhhhmmmmeeeemmmm____lllloooonnnngggglllloooonnnngggg____wwwwaaaaiiiitttt((((lllloooonnnngggg lllloooonnnngggg ****_v_a_r,,,, lllloooonnnngggg lllloooonnnngggg _v_a_l_u_e))));;;;
  27.  
  28.         vvvvooooiiiidddd sssshhhhmmmmeeeemmmm____lllloooonnnngggglllloooonnnngggg____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll((((lllloooonnnngggg lllloooonnnngggg ****_v_a_r,,,, iiiinnnntttt _c_o_n_d,,,, lllloooonnnngggg lllloooonnnngggg
  29.         _v_a_l_u_e))));;;;
  30.  
  31.         vvvvooooiiiidddd sssshhhhmmmmeeeemmmm____sssshhhhoooorrrrtttt____wwwwaaaaiiiitttt((((sssshhhhoooorrrrtttt ****_v_a_r,,,, sssshhhhoooorrrrtttt _v_a_l_u_e))));;;;
  32.  
  33.         vvvvooooiiiidddd sssshhhhmmmmeeeemmmm____sssshhhhoooorrrrtttt____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll((((sssshhhhoooorrrrtttt ****_v_a_r,,,, iiiinnnntttt _c_o_n_d,,,, sssshhhhoooorrrrtttt _v_a_l_u_e))));;;;
  34.  
  35.         vvvvooooiiiidddd sssshhhhmmmmeeeemmmm____wwwwaaaaiiiitttt((((lllloooonnnngggg ****_i_v_a_r,,,, lllloooonnnngggg _c_m_p__v_a_l_u_e))));;;;
  36.  
  37.         vvvvooooiiiidddd sssshhhhmmmmeeeemmmm____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll((((lllloooonnnngggg ****_i_v_a_r,,,, iiiinnnntttt _c_m_p,,,, lllloooonnnngggg _v_a_l_u_e))));;;;
  38.  
  39.      Fortran:
  40.  
  41.         IIIINNNNCCCCLLLLUUUUDDDDEEEE """"mmmmpppppppp////sssshhhhmmmmeeeemmmm....ffffhhhh""""
  42.  
  43.         CCCCAAAALLLLLLLL SSSSHHHHMMMMEEEEMMMM____IIIINNNNTTTT4444____WWWWAAAAIIIITTTT((((_i_v_a_r,,,, _c_m_p__v_a_l_u_e))))
  44.  
  45.         CCCCAAAALLLLLLLL SSSSHHHHMMMMEEEEMMMM____IIIINNNNTTTT4444____WWWWAAAAIIIITTTT____UUUUNNNNTTTTIIIILLLL((((_i_v_a_r,,,, _c_m_p,,,, _c_m_p__v_a_l_u_e))))
  46.  
  47.         CCCCAAAALLLLLLLL SSSSHHHHMMMMEEEEMMMM____IIIINNNNTTTT8888____WWWWAAAAIIIITTTT((((_i_v_a_r,,,, _c_m_p__v_a_l_u_e))))
  48.  
  49.         CCCCAAAALLLLLLLL SSSSHHHHMMMMEEEEMMMM____IIIINNNNTTTT8888____WWWWAAAAIIIITTTT____UUUUNNNNTTTTIIIILLLL((((_i_v_a_r,,,, _c_m_p,,,, _c_m_p__v_a_l_u_e))))
  50.  
  51.         CCCCAAAALLLLLLLL SSSSHHHHMMMMEEEEMMMM____WWWWAAAAIIIITTTT((((_i_v_a_r,,,, _c_m_p__v_a_l_u_e))))
  52.  
  53.         CCCCAAAALLLLLLLL SSSSHHHHMMMMEEEEMMMM____WWWWAAAAIIIITTTT____UUUUNNNNTTTTIIIILLLL((((_i_v_a_r,,,, _c_m_p,,,, _c_m_p__v_a_l_u_e))))
  54.  
  55. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  56.      sssshhhhmmmmeeeemmmm____wwwwaaaaiiiitttt and sssshhhhmmmmeeeemmmm____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll wait for _i_v_a_r to be changed by a
  57.      remote write or atomic swap issued by a different processor.  These
  58.      routines can be used for point-to-point directed synchronization.  A
  59.      call to sssshhhhmmmmeeeemmmm____wwwwaaaaiiiitttt does not return until some other processor writes a
  60.      value, not equal to _c_m_p__v_a_l_u_e, into _i_v_a_r on the waiting processor.  A
  61.      call to sssshhhhmmmmeeeemmmm____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll does not return until some other processor
  62.      changes _i_v_a_r to satisfy the condition implied by _c_m_p and _c_m_p__v_a_l_u_e.
  63.      This mechanism is useful when a processor needs to tell another
  64.      processor that it has completed some action.
  65.  
  66.      The arguments are as follows:
  67.  
  68.      _i_v_a_r    A remotely accessible integer variable that is being updated
  69.              by another PE.  If you are using C/C++, the type of _i_v_a_r
  70.              should match that implied in the SYNOPSIS section. If you are
  71.              using Fortran, _i_v_a_r must be a specific sized integer type
  72.              according to the function being called, as follows:
  73.  
  74.              FFFFuuuunnnnccccttttiiiioooonnnn                 TTTTyyyyppppeeee ooooffff _i_v_a_r
  75.  
  76.              sssshhhhmmmmeeeemmmm____wwwwaaaaiiiitttt
  77.              sssshhhhmmmmeeeemmmm____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll         default IIIINNNNTTTTEEEEGGGGEEEERRRR
  78.  
  79.              sssshhhhmmmmeeeemmmm____iiiinnnntttt4444____wwwwaaaaiiiitttt
  80.              sssshhhhmmmmeeeemmmm____iiiinnnntttt4444____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll    IIIINNNNTTTTEEEEGGGGEEEERRRR****4444
  81.  
  82.              sssshhhhmmmmeeeemmmm____iiiinnnntttt8888____wwwwaaaaiiiitttt
  83.              sssshhhhmmmmeeeemmmm____iiiinnnntttt8888____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll    IIIINNNNTTTTEEEEGGGGEEEERRRR****8888
  84.  
  85.      _c_m_p     The compare operator that compares _i_v_a_r with _c_m_p__v_a_l_u_e.  _c_m_p
  86.              must be of type integer.  If you are using Fortran, it must be
  87.              of default kind.  If you are using C/C++, the type of _c_m_p
  88.              should match that implied in the SYNOPSIS section.
  89.  
  90.              The following _c_m_p values are supported:
  91.  
  92.              _c_m_p VVVVaaaalllluuuueeee           CCCCoooommmmppppaaaarrrriiiissssoooonnnn
  93.  
  94.              SSSSHHHHMMMMEEEEMMMM____CCCCMMMMPPPP____EEEEQQQQ        Equal
  95.  
  96.              SSSSHHHHMMMMEEEEMMMM____CCCCMMMMPPPP____NNNNEEEE        Not equal
  97.  
  98.              SSSSHHHHMMMMEEEEMMMM____CCCCMMMMPPPP____GGGGTTTT        Greater than
  99.  
  100.              SSSSHHHHMMMMEEEEMMMM____CCCCMMMMPPPP____LLLLEEEE        Less than or equal to
  101.  
  102.              SSSSHHHHMMMMEEEEMMMM____CCCCMMMMPPPP____LLLLTTTT        Less than
  103.  
  104.              SSSSHHHHMMMMEEEEMMMM____CCCCMMMMPPPP____GGGGEEEE        Greater than or equal to
  105.  
  106.      _c_m_p__v_a_l_u_e
  107.              _c_m_p__v_a_l_u_e must be of type integer.  If you are using C/C++,
  108.              the type of _c_m_p__v_a_l_u_e should match that implied in the
  109.              SYNOPSIS section.  If you are using Fortran, _c_m_p__v_a_l_u_e must be
  110.              an integer of the same size and kind as _i_v_a_r.
  111.  
  112.      The sssshhhhmmmmeeeemmmm____wwwwaaaaiiiitttt routines return when _i_v_a_r is no longer equal to
  113.      _c_m_p__v_a_l_u_e.
  114.  
  115.      The sssshhhhmmmmeeeemmmm____wwwwaaaaiiiitttt____uuuunnnnttttiiiillll routines return when the compare condition is
  116.      true.  The compare condition is defined by the _i_v_a_r argument compared
  117.      with the _c_m_p__v_a_l_u_e using the comparison operator, _c_m_p.
  118.  
  119. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  120.      Example 1:  The following call returns when variable _i_v_a_r is not equal
  121.      to 100:
  122.  
  123.           INTEGER*8 IVAR
  124.           CALL SHMEM_INT8_WAIT(IVAR, INT8(100))
  125.  
  126.      Example 2:  The following call to SSSSHHHHMMMMEEEEMMMM____IIIINNNNTTTT8888____WWWWAAAAIIIITTTT____UUUUNNNNTTTTIIIILLLL is equivalent
  127.      to the call to SSSSHHHHMMMMEEEEMMMM____IIIINNNNTTTT8888____WWWWAAAAIIIITTTT in example 1:
  128.  
  129.           INTEGER*8 IVAR
  130.           CALL SHMEM_INT8_WAIT_UNTIL(IVAR, SHMEM_CMP_NE, INT8(100))
  131.  
  132.      Example 3:  The following C/C++ call waits until the sign bit in iiiivvvvaaaarrrr
  133.      is set by a transfer from a remote PE:
  134.  
  135.           int ivar;
  136.           shmem_int_wait_until(&ivar, SHMEM_CMP_LT, 0);
  137.  
  138.      Example 4:  The following Fortran example is in the context of a
  139.      subroutine:
  140.  
  141.          SUBROUTINE EXAMPLE()
  142.          INTEGER FLAG_VAR
  143.          COMMON/FLAG/FLAG_VAR
  144.          . . .
  145.          FLAG_VAR = FLAG_VALUE    !  initialize the event variable
  146.          . . .
  147.          IF (FLAG_VAR .EQ.  FLAG_VALUE) THEN
  148.                  CALL SHMEM_WAIT(FLAG_VAR, FLAG_VALUE)
  149.          ENDIF
  150.          FLAG_VAR = FLAG_VALUE    !  reset the event variable for next time
  151.          . . .
  152.          END
  153.  
  154. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  155.      iiiinnnnttttrrrroooo____sssshhhhmmmmeeeemmmm(3), sssshhhhmmmmeeeemmmm____ppppuuuutttt(3)
  156.  
  157.      _M_e_s_s_a_g_e _P_a_s_s_i_n_g _T_o_o_l_k_i_t: _M_P_I _P_r_o_g_r_a_m_m_e_r'_s _M_a_n_u_a_l
  158.